package ch5.hw2;

import javax.swing.JOptionPane;

import ch6.ex1.Person;

//arguments: name age name age name age
//pick the oldest
//the oldest is: in JPane

public class hw2 {
	public static void main(String[] args) {

		Person kris = new Person();
		Person mark = new Person();
		Person ewka = new Person();
		Person max = new Person();

		kris.name = "Kris";
		kris.age = 31;
		mark.name = "Mark";
		mark.age = 32;
		ewka.name = "Ewka";
		ewka.age = 30;
		max.name = "max";
		max.age = 0;

		max = (kris.age > mark.age) ? kris : mark;

		max = (max.age > ewka.age) ? max : ewka;

		JOptionPane.showMessageDialog(null, "The oldest is " + max.name);
	}
}
